// Resource Manager
// (c) jimon game studio

#ifndef JEH_IRESOURCEMANAGER
#define JEH_IRESOURCEMANAGER

#include "IDataBase.h"
#include "IResource.h"
#include "IBuffer.h"

namespace je
{
	namespace media
	{
		//! Resource Factory Base
		class IResourceFactory:public je::jeUnknown
		{
		public:
			//! Destructor
			virtual ~IResourceFactory()
			{
			}

			//! Add Resources
			virtual void AddResources(IResource * Resource) = 0;

			//! Load Resources
			virtual void LoadResources() = 0;

			//! Clear Resources
			virtual void ClearResources() = 0;

			//! Return Resource
			virtual IResource * GetResource(const jeStringc & ResourceName) = 0;

			//! Return Resource Type
			virtual jeStringc GetResourceType() = 0;

			//! Garbage Collector
			virtual void GarbageCollector() = 0;
		};

		//! Resource Manager
		class IResourceManager:public je::jeUnknown
		{
		public:
			//! Destructor
			virtual ~IResourceManager()
			{
			}

			//! Set Data Base
			virtual void SetDataBase(core::IDataBase * DataBase) = 0;

			//! Get Data Base
			virtual core::IDataBase * GetDataBase() = 0;

			//! Get Resource
			virtual IResource * GetResource(const jeStringc & ResourceType,const jeStringc & ResourceName) = 0;

			//! Get Resource Factory
			virtual IResourceFactory * GetResourceFactory(const jeStringc & ResourceType) = 0;

			//! Register Resource Factory
			virtual void RegisterResourceFactory(IResourceFactory * Factory) = 0;

			//! Garbage Collector
			virtual void GarbageCollector() = 0;
		};

		DECLARE_SINGLETON_E(JE_ENGINE_FUNCTION_API,JE_ENGINE_FUNCTION_CALL,ResourceManager)
	}
}

#endif
